import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import UserLogin from "@/views/userLogin.vue";
import UserRegister from "@/views/userRegister.vue";
import UserLayout from "@/components/UserLayout.vue";
import person from "@/components/PessonView.vue"
import CameraView from "@/components/CameraView.vue";
import RecordingView from "@/components/RecordingView.vue";
import MachineryView from "@/components/MachineryView.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path:"/user",
    name:"用户",
    component:UserLayout,
    children:[
      {
        path:"/user/login",
        name:"用户登录",
        component:UserLogin,
      },
      {
        path:"/user/register",
        name:"用户注册",
        component:UserRegister,
      }
    ],
    meta:{
      hideInMenu: true,
    }
  },
  {
    path: "/person",
    name: "人员管理",
    component: person
  }
  ,
  {
    path: "/Camera",
    name: "房间管理",
    component: CameraView
  },
  {
    path: "/Recording",
    name: "监控管理",
    component: RecordingView
  },
  {
    path: "/Machinery",
    name: "器械管理",
    component: MachineryView
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
